<template>
  <div>
    <h1>我是day08</h1>
    <button @click="btn">调用student</button>
    <button @click="btn1">调用school</button>
  </div>
</template>

<script>
import axios from 'axios'
import {getM} from '../api/api'
export default {
    name:"MyDay08",
    methods: {
        btn(){
            axios.get("http://localhost:8080/api1/student").then(
                (res)=> {
                    console.log("请求成功"+res);
            } , (error)=>{
                console.log("请求失败"+error.message);
            })
        },
        async btn1(){
            const datas = await getM();
            console.log(datas);
        }
    }
}
</script>

<style>

</style>